<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  User: Ivan wei
  --%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生系统</title>
    <style>
        table{
            text-align: center;
        }
        tr{
            height: 40px;
        }
        input{

            text-align: center;
            width: 100%;
            height: 40px;
            border: 0px;
            outline:0
        }
        .button-in:hover{
            background-color: aqua;
        }
    </style>
</head>
<body>
<br><br><br><br><br>
<h1 style="text-align: center">学生系统</h1>
<hr>
<%@ include file="/common.jsp" %>
<div style="text-align: center">
    <H2>更新学生信息</H2>
    <div style="width: 100% ;height: 45px;border: 1px;display: flex;align-items: center;justify-content: space-evenly;">
        <a href="/Administrator/personStu.do"> 学生显示</a>
        <a href="/Administrator/personStu/addStu.do"> 学生添加</a>
    </div>
    <hr>
    <div style="display: flex;justify-content: center;">
        <table width="630px" border="1" cellspacing="0" >
            <form method="post" action="/Administrator/personStu/updateStu.do">
                <tr>
                    <td>学生学号：</td><td><input type="text" required="required" oninput="value=value.replace(/[^\d]/g,'')" name="id" value="${goStu.sid}" ></td>
                </tr>
                <tr>
                    <td>学生姓名：</td><td><input type="text" required="required"  name="name" value="${goStu.sname}"></td>
                </tr>
                <tr>
                    <td>学生用户：</td><td><input type="text" required="required" oninput="value=value.replace(/[^\d]/g,'')" name="phone" value="${goStu.user}"></td>
                </tr>
                <tr>
                    <td>用户密码：</td><td><input type="text" required="required"  name="pwd" value="${goStu.pwd}"></td>
                </tr>
                <tr>
                    <td>班级名称：</td><td>
                    <select name="cid">
                        <c:forEach var="Clazz" items="${list}">
                            <c:if test="${Clazz.id!=goStu.cname}" >
                                <option value="${Clazz.id}">${Clazz.name}</option>
                            </c:if>
                            <c:if test="${Clazz.id==stu.clazz}" >
                                <option value="${Clazz.clzno}"  selected>${Clazz.name}</option>
                            </c:if>
                        </c:forEach>
                    </select>
                       </td>
                </tr>
                <tr>
                    <td></td><td><input class="button-in" type="submit" value="提交"></td>
                </tr>
            </form>
        </table>
        <br>
    </div>
</div>
</body>
</html>
